﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dal
{
    public class MyDbContext : DbContext
    {
        public MyDbContext(DbContextOptions<MyDbContext> options) : base(options)
        {
        }
        public DbSet<T_Admin> T_Admin { get; set; }



        public class DbContextDesignTimeFactory : IDesignTimeDbContextFactory<MyDbContext>
        {
            public MyDbContext CreateDbContext(string[] args)
            {
                DbContextOptionsBuilder<MyDbContext> builder = new DbContextOptionsBuilder<MyDbContext>();
                builder.UseSqlServer("Data Source=.;Initial Catalog=SmartyHotel;Integrated Security=True");
                return new MyDbContext(builder.Options);
            }
        }
    }
}
